<?php
namespace  App\Models;
use EasySwoole\ORM\AbstractModel;
use EasySwoole\ORM\Utility\Schema\Table;

/**
 * Created by PhpStorm.
 * User: zq2020
 * Date: 20-2-26
 * Time: 下午11:45
 */
class SubUser extends AbstractModel
{
    /**
     * 表的获取
     * 此处需要返回一个 EasySwoole\ORM\Utility\Schema\Table
     * @return Table
     */
    protected $tableName="easy_sub_user";
    protected $connectionName="default";
    protected $autoTimeStamp = true;
    protected $createTime = 'create_time';
    protected $updateTime = 'update_time';

    public function schemaInfo(bool $isCache=true):Table{
        $table = new Table($this->tableName);
        $table->colInt('id')->setIsPrimaryKey(true)->setIsAutoIncrement();
        $table->colInt('money', 11);
        $table->colDate("create_time");
        $table->colDate("update_time");
        return $table;
    }
}
